#= require mobile/zepto.min
#= require mobile/swipe.min

$ ->
  FastClick.attach(document.body)

  $('.list_container .main_item').click ->
    el = $(@)
    $('.main_item').removeClass('active')
    el.addClass('active')
    if el.siblings('.sub_item').length != 0
      $('.sub_item').removeClass('active')
      el.siblings('.sub_item').addClass('active')

  $('.ico_user').click (e)->
    $('.user_list').show()
    e.preventDefault()
    e.stopPropagation()

  $(".sub_menu").click (e)->
    list_id = $(this).data("list-id")
    qblist = $("#" + list_id)
    if $(this).hasClass("current")
      qblist.hide()
      qblist.removeClass('current')
      $(this).removeClass "current"
    else
      $('.qblist.current').removeClass('current').hide()
      qblist.show()
      qblist.addClass('current')
      $('.sub_menu').removeClass "current"
      $(this).addClass "current"
    e.stopPropagation()
